package com.semis.common.enums;

import java.util.stream.Stream;

/**
 * 报警的状态
 */
public enum WorkAlarmStatus {

    /**
     * 未处理，报警中
     */
    ALARMING("0", "未处理"),
    /**
     * 已处理
     */
    HAS_DEAL("1", "已处理");


    private final String code;

    private final String desc;

    WorkAlarmStatus(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static WorkAlarmStatus getByCode(String code) {
        return Stream.of(WorkAlarmStatus.values()).filter(w -> w.getCode().equals(code)).findAny().orElse(null);
    }


}
